<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="id" lang="id">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script>
		window.addEvent('domready', function(){ 
			new Picker.Date('vista1', {
				pickerClass: 'datepicker_vista'
			});
			new Picker.Date('vista2', {
				pickerClass: 'datepicker_vista'
			});
		});
</script>
</head>
<body>
	 <html:form action="/leaveRequestUpdate">
	 <br/>
	 <html:hidden property="id"/>
	 	<table style="padding-left: 8px;">
	 		<tr>
	 			<td>Supervisor:</td>
	 			<td> 
	 				<html:select name="leaveRequestUpdate" property="supervisorNum" style="width:150px;">
						<html:optionsCollection property="supervisorList" label="label" value="value" />
					</html:select>
	 			</td>
	 			<td>&nbsp;Leave type:</td>
	 			<td> 
	 				<html:select name="leaveRequestUpdate" property="leaveTypeId" style="width:100px;">
						<html:optionsCollection property="leaveTypeList" label="name" value="id" />
					</html:select>
	 			</td>
	 		</tr>
	 		<tr>
	 			<td>Leave from:</td>
	 			<td><html:text property="firstLeaveStr" styleId="vista1" style="width:150px;"/></td>
	 			 <td>&nbsp;Time:</td>
	 			 <td>
	 			 	<html:select name="leaveRequestUpdate" property="firstTimeValue" style="width:100px;">
						<html:optionsCollection property="listFirstTime" label="label" value="value" />
					</html:select>
	 			 </td>
	 		</tr>
	 		<tr>
	 			<td>Leave to:</td>
	 			<td><html:text property="lastLeaveStr" styleId="vista2" style="width:150px;"/></td>
	 			<td>&nbsp;Time:</td>
	 			 <td>
	 			 	<html:select name="leaveRequestUpdate" property="lastTimeValue" style="width:100px;">
						<html:optionsCollection property="listLastTime" label="label" value="value" />
					</html:select>
	 			 </td>
	 		</tr> 
	 		<tr>
	 			<td colspan="4"></td>
	 		</tr>
	 		<tr>
	 			<td>Emp's comment:</td>
	 			<td colspan="3"><html:textarea property="empComment" style="width:100%;height:100px;"></html:textarea></td>
	 		</tr>
	 		<tr>
	 			<td></td>
	 			<td>Paid leaved:&nbsp;
	 				<bean:write name="leaveRequestUpdate" property="totalPaidLeaved"/>
	 			</td>
	 			<td colspan="2">Other types:&nbsp;
	 				<bean:write name="leaveRequestUpdate" property="totalOtherLeaved"/>
	 			</td> 
	 		</tr>
	 		<tr>
	 			<td></td>
	 			<td colspan="3"><center><a style="color: red;"><bean:write name="leaveRequestUpdate" property="message"/></a></center></td>
	 		</tr>
	 	</table>
	 	<center>
	 		<logic:equal name="leaveRequestUpdate" property="isAddNew" value="true">
				<input type="button" value="Add" name="btnAdd" class="sbutton" id="btnAdd" onclick="postParams('act=add&btnAdd');"></input>
			</logic:equal>
			<logic:equal name="leaveRequestUpdate" property="isAddNew" value="false">
				<input type="button" value="Update" name="btnEdit" class="sbutton" id="btnEdit" onclick="postParams('act=edit&btnEdit');"></input>
			</logic:equal>
			<input type="reset" value="Reset" class="sbutton"></input>
	 	</center>
	 </html:form>
</body>
</html>